package com.cmy.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

//@Component  等价于    <bean id="user" class="com.cmy.pojo.User"/>
@Component
@Scope("singleton")
public class User {
    //相当于<properties name = "name value="cmy"/>
    @Value("cmy")
    private String name;

    public String getName() {
        return name;
    }
    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                '}';
    }
}

    